package com.spic.business.train.plan.domain;

import com.spic.common.core.annotation.Excel;
import com.spic.common.core.exception.ServiceException;
import com.spic.common.core.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@ApiModel(value = "培训人数")
@Data
public class TrainPlanStaff {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    private String id;

    /**
     * 父id
     */
    @ApiModelProperty(value = "父id")
    private String trainPlanId;

    /**
     * 人员类别
     */
    @ApiModelProperty(value = "人员类别")
    @Excel(name = "人员类别")
    private String type;

    /**
     * 参培人数
     */
    @ApiModelProperty(value = "参培人数")
    @Excel(name = "参培人数")
    private Integer number;

    public void checkParam(){
        if (StringUtils.isEmpty(this.type))
            throw new ServiceException("人员类别不能为空");
        if (this.number == null)
            throw new ServiceException("参加培训人数不能为空");
    }
}

